﻿using LanguagePolish.EntityModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LanguagePolish.Controls.Meta
{
    class AllLessonsProvider : ILessonsProvider
    {
        private static AllLessonsProvider provider = new AllLessonsProvider();
        public static AllLessonsProvider Instance { get { return provider; } }

        public IEnumerable<Lesson> GetLessons(DateTime from, DateTime to)
        {
            var context = LinksProvider.Model.EntityContext;
            var res = context.Lessons.Where(l => l.LessonDate >= from && l.LessonDate <= to).ToList();
            return res;
        }
    }
}
